package com.ddyx.rest;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ddyx.service.UserAddressService;
import com.ddyx.util.RequestForm;
import com.ddyx.util.ResponseForm;

@Controller
@RequestMapping("/user")
public class UserAddressController {
	
	@Resource
	UserAddressService  userAddressService;
	/**
	 * @Description  获取用户邮寄地址
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/v1.5/getUserAddress", method = RequestMethod.POST)
	public ResponseForm getUserAddress(@RequestBody RequestForm param) {
		return userAddressService.getUserAddress(param);
	}
	
	/**
	 * @Description 新增用户邮寄地址
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/v1.5/addUserAddress", method = RequestMethod.POST)
	public ResponseForm addUserAddress(@RequestBody RequestForm param) {
		return userAddressService.addUserAddress(param);
	}
	
	/**
	 * @Description 修改用户邮寄地址
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/v1.5/updateUserAddress", method = RequestMethod.POST)
	public ResponseForm updateUserAddress(@RequestBody RequestForm param) {
		return userAddressService.updateUserAddress(param);
	}
	
	/**
	 * @Description 根据ID查询用户邮寄地址
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/v1.5/getUserAddressById", method = RequestMethod.POST)
	public ResponseForm getUserAddressById(@RequestBody RequestForm param) {
		return userAddressService.getUserAddressById(param);
	}
}
